import request from '../../utils/httpRequest'

const category = '/product/product/category'

export function getCategoryListTree () {
  return request({
    url: `${category}/list/tree`,
    method: 'get'
  })
}

// 根据ids批量删除
export function deleteCategoryByIds (data) {
  return request({
    url: `${category}/delete`,
    method: 'delete',
    data
  })
}

// 根据id查询
export function getCategoryById (id) {
  return request({
    url: `${category}/info/${id}`,
    method: 'get'
  })
}

// 新增
export function saveCategory (data) {
  return request({
    url: `${category}/save`,
    method: 'post',
    data
  })
}

// 修改
export function updateCategory (data) {
  return request({
    url: `${category}/update`,
    method: 'put',
    data
  })
}

// 批量更新
export function updateCategoryBatch (data) {
  return request({
    url: `${category}/batch/update`,
    method: 'put',
    data
  })
}
